package com.holly.unit.bpmn.activiti.pojo;

import com.holly.unit.auth.api.pojo.login.LoginUser;
import com.holly.unit.core.tree.factory.base.AbstractTreeNode;
import com.holly.unit.core.tree.xmtree.base.AbstractXmSelectNode;
import com.holly.unit.scanner.api.annotation.field.ChineseDescription;
import lombok.Data;

import java.util.List;

/**
 * 类描述: bpmn 模型树
 *
 * @author fxr
 * @version 1.0.0
 * @date 2022/4/25 17:41
 */
@Data
public class BpmnModelTreeNode implements AbstractTreeNode<BpmnModelTreeNode>, AbstractXmSelectNode {

    /**
     * 父id，一级节点父id是0
     */
    @ChineseDescription("父id，一级节点父id是0")
    private String parentId;

    /**
     * 节点名称
     */
    @ChineseDescription("节点名称")
    private String title;

    /**
     * 节点值
     */
    @ChineseDescription("节点值")
    private String id;

    @ChineseDescription("模型id")
    private String modelId;

    @ChineseDescription("节点类型")
    private String type;

    /**
     * 是否展开状态 不展开-false 展开-true
     */
    @ChineseDescription("是否展开状态 不展开-false 展开-true")
    private boolean spread = true;

    /**
     * 是否选中
     */
    @ChineseDescription("是否选中")
    private boolean selected = false;

    /**
     * 子节点的集合
     */
    @ChineseDescription("子节点的集合")
    private List<BpmnModelTreeNode> children;

    /**关联角色*/
    private List<ActivitiRole> roles;
    /**关联用户*/
    private List<LoginUser> users;
    /**关联部门*/
    private List<ActivitiDepartment> departments;

    /**选操作人的部门负责人*/
    private Boolean chooseDepHeader = false;
    /**选操作人*/
    private Boolean chooseSponsor = false;



    @Override
    public String getNodeId() {
        return this.id.toString();
    }

    @Override
    public String getNodeParentId() {
        return this.parentId.toString();
    }

    @Override
    public void setChildrenNodes(List<BpmnModelTreeNode> childrenNodes) {
        this.children = childrenNodes;
    }

    @Override
    public String getName() {
        return this.title;
    }

    @Override
    public String getValue() {
        return String.valueOf(id);
    }

    @Override
    public Boolean getSelected() {
        return this.selected;
    }

    @Override
    public Boolean getDisabled() {
        return false;
    }

    @Override
    public List getChildren() {
        return this.children;
    }

}
